﻿using System.Diagnostics.Contracts;
using T4UtilityBelt.Writers;

namespace T4UtilityBelt.UxDesigns.Screens2.Renders.ViewModel
{
    public class EntityCreateScreenRenderer : IEntityCreateScreenRenderer
    {
        public void RenderParentClass(EntityCreateScreen control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            writer.Write(string.Format("CreateEntityViewModel<{0}Model, {0}Entity>", control.EntityName));
        }


        public void RenderCode(EntityCreateScreen control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            writer.Write(string.Format(@"
        public {0}CreateEntityViewModel({0}ModelParameters parameters)
        {{
        }}

        public {0}CreateEntityViewModel()
        {{
        }}

", control.EntityName));
        }

        public void RenderControls(EntityCreateScreen control, CodeWriter writer)
        {
            Contract.Assert(control != null);
            Contract.Assert(writer != null);

            control.Controls.RenderViewModelCs(writer);
        }

    }
}
